package com.swift.config;

import com.swift.service.MailService;
import com.swift.service.impl.MailServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(EmailBean.class)
@Slf4j
public class EmailAutoConfigration {
    @Autowired
    private EmailBean emailBean;
    static {
       log.info("email init ....");
    }
    @Bean
    public MailService mailService(){
        return new MailServiceImpl(emailBean);
    }

}
